package ua.org.enginer.controls
{
	import flash.events.KeyboardEvent;
	
	import mx.collections.ArrayCollection;
	import mx.controls.DataGrid;
	import mx.events.ListEvent;

	public class HotKeysDataGrid extends DataGrid
	{
		public function HotKeysDataGrid()
		{
			super();
			
			//addEventListener(KeyboardEvent.KEY_DOWN, onKetDown)
		}
		
		override protected function keyDownHandler(event:KeyboardEvent) : void {
			super.keyDownHandler(event);
			//if (event.ctrlKey && event.keyCode == 65) {
			if (event.keyCode == 65) {
				// Ctrl+A
				// A
				selectedItems = ArrayCollection(collection).toArray();
				dispatchEvent(new ListEvent(ListEvent.ITEM_CLICK));
			}
		}
	}
}